#ifndef KGAME_H
#define KGAME_H

#include <QObject>
#include <QtCore>

/**
  Common path IDs:
        savegame - Folder where saved games are stored
        config - Folder where configuration are stored
        screenshot - Screenshots
        root - Folder where game is installed
        stats - On some games we can get the statistics of game, we can use it for something

        !!** When we use a custom ID we need to declarate it on CVAR table **!!

  Valid paths variables:
        ** LINUX **
        $CONFDIR - "/etc/foo" base configuration directory
        $TEMPDIR - Temporal directory

        ** WINDOWS **
        $PROGFILES - "Program Files" directory
        $APPDIR - Application directory (ps: in linux we always use ~/.kongm for work, we not need a variable)

        ** ALL **
        $HOMEDIR - User personal folder. "My Documents" on Windows "home/user" on Linux
        $INSTDIR - Installation directory

  */

class kGame : public QObject
{
    public:
        kGame( int id = -1 );
        ~kGame();

        bool    load( int id );
        bool    save();
        bool    update();

        void    setName( QString txt );
        void    setName( const char *txt );

        /** for example (see above):
            setPath( "savegame", "%INSTDIR\save");
            setPath( "screenshots", "%MYDOCS\gamename\screenshots" );
        */
        void    setPath( QString id, QString path );
        void    setPath( const char *id, const char *path );

        QStringList     *getPaths();

        void    setAutosync( bool state );
        void    setUpload( bool state );

        void    setLastSync( QDate date );
        void    setLastUpload( QDate date );

        /**
          Prepare game for storage on any system, like CD, DVD, USB, HardDisk, Internet
          or same computer compressed to save space.

          **@IDEA**
             We can use 7zip, RAR, bzip2 or any kind of compression system with password
             security.
          */
        bool    prepareForStorage( QString path );
        bool    prepareForRestore();        

    private:
        int     id;

        QString name;

        int     autosync;
        int     upload;

        QDate   lastSync;
        QDate   lastUpload;

        /// Get all registry keys and save it for future use.
        bool    getAssociatedRegister();
};

#endif // KGAME_H
//
// id int INCREMENTAL primary key, int profile int(5), name varchar(256), path TEXT, savepath TEXT, lupdate varchar(32), autosync int(1), upload int(1),
// lastsync text, lastupload text
//
